home *** CD-ROM | disk | FTP | other *** search
/ Star Festival... a Return to Japan / Star Festival... a Return to Japan.iso / pc / STARFESTIVAL / Shared.Cst / 00006_Vox Object.ls < prev    next >
Encoding:
Text File  |  1999-10-10  |  1.5 KB  |  73 lines

  1. property pSoundList,pCurrentVox
  2.  
  3. on new me
  4.   set pCurrentVox = ""
  5.   set pSoundList = []
  6.   return me
  7. end new
  8.  
  9. on mDoVoxThing me,voxToPlay
  10.   
  11.   -- Note:  mStopVox resets pCurrentVox
  12.   if (voxToPlay = pCurrentVox) then
  13.     mStopVox(me)
  14.     return (-1)
  15.   else if (soundBusy(3)) then
  16.     mStopVox (me)
  17.   end if
  18.   
  19.   set pCurrentVox = voxToPlay
  20.   mLowerSounds (me)
  21.   set aFileName = the fileName of cast voxToPlay
  22.   if (aFileName = "") then
  23.     puppetSound 3,voxToPlay
  24.     updateStage
  25.   else
  26.     sound playFile 3, aFileName
  27.   end if
  28.   return (0)
  29. end mDoVoxThing
  30.  
  31. on mStopVox me
  32.   mRaiseSounds (me)
  33. end mStopVox
  34.  
  35. on mMyStepFrame me
  36.   global gMyActorList
  37.   if ((pCurrentVox <> "") and not(soundBusy(3))) then
  38.     mStopVox (me)
  39.     set gMyActorList = []
  40.   end if
  41. end mMyStepFrame
  42.  
  43. on mLowerSounds me
  44.   set pSoundList = []
  45.   repeat with i = 1 to 48
  46.     if (the type of the member of sprite i = #digitalVideo) then
  47.       add(pSoundList,i)
  48.       set the volume of sprite i = 50
  49.     end if
  50.   end repeat
  51. end mLowerSounds
  52.  
  53. on mRaiseSounds me
  54.   sound stop 3
  55.   set pCurrentVox = ""
  56.   if (not(listP(pSoundList))) then
  57.     exit
  58.   end if
  59.   if (count(pSoundList) = 0) then
  60.     exit
  61.   end if
  62.   repeat with i in pSoundList
  63.     -- Add in a check, just in case a sprite or something happened
  64.     -- to change in between calls...
  65.     if (the type of the member of sprite i = #digitalVideo) then
  66.       set the volume of sprite i = 255
  67.     else
  68.       -- if debugging, this should never happen.
  69.     end if
  70.   end repeat
  71.   --updateStage
  72. end mRaiseSounds
  73.